package com.demo.consumer;

import com.itdl.mq.base.AbstractStreamConsumerListener;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.redis.connection.stream.MapRecord;
import org.springframework.stereotype.Component;

/**
 * test consumer
 */
@Component
@Slf4j
public class TestConsumer3 extends AbstractStreamConsumerListener {

    @Override
    protected void handleMessage(MapRecord<String, String, String> message) {
        log.info("stream:{}, data:{}", message.getStream(), message.getValue());
        try {
            Thread.sleep(100);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        log.info("TestConsumer3 handle data");
    }
}
